package org.dromara.common.translation.core.impl;

import lombok.AllArgsConstructor;
import org.apache.dubbo.config.annotation.DubboReference;
import org.dromara.common.translation.annotation.TranslationType;
import org.dromara.common.translation.constant.TransConstant;
import org.dromara.common.translation.core.TranslationInterface;
import org.dromara.tearoom.api.RemoteAppUserService;

/**
 * 会员手机号翻译实现
 *
 * @author ckj
 */
@AllArgsConstructor
@TranslationType(type = TransConstant.MEMBER_USER_ID_TO_MOBILE)
public class MemberUserMobileTranslationImpl implements TranslationInterface<String> {

    @DubboReference
    private RemoteAppUserService remoteAppUserService;

    @Override
    public String translation(Object key, String other) {
        return remoteAppUserService.selectPhoneById((Long) key);
    }
}
